package com.java.juc;

/**
 * @author wangning
 * @date 2023/5/15 16:59
 */
public enum CountryEnum {

    ONE(1, "齐"), TWO(2, "楚"), THREE(3, "燕"), FOUR(4, "赵"), FIVE(5, "魏"), SIX(6, "韩");
    private final Integer key;
    private final String name;

    CountryEnum(Integer key, String name) {
        this.key = key;
        this.name = name;
    }

    public static CountryEnum foreach_CountryEnum(int index) {
        CountryEnum[] values = CountryEnum.values();
        for (CountryEnum element : values) {
            if (index == element.getKey()) {
                return element;
            }
        }
        return null;
    }

    public Integer getKey() {
        return key;
    }

    public String getName() {
        return name;
    }
}
